package com.scpii.universal.service;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.hibernate.LockMode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;

import com.scpii.universal.hibernate.dao.BaseDao;
import com.scpii.universal.hibernate.entity.AppPageViewTab;
import com.scpii.universal.hibernate.entity.AppPageViewTab;
import com.scpii.universal.hibernate.intface.BaseInterface;
import com.scpii.universal.util.SpringBeanFactory;

public class AppPageViewTabService implements BaseInterface<AppPageViewTab> {
	private static final Logger log = LoggerFactory
			.getLogger(AppPageViewTabService.class);
//	private BaseDao<AppPageViewTab> appPageViewTabDao = SpringBeanFactory.appPageViewTabDao;
	private BaseDao<AppPageViewTab> appPageViewTabDao;
	public AppPageViewTab get(Integer id) throws Exception {
		return appPageViewTabDao.get(id);
	}

	public List<AppPageViewTab> getAll() throws Exception {
		return appPageViewTabDao.getAll();
	}

	public AppPageViewTab get(String propertyName, Object value)
			throws Exception {
		return null;
	}

	public List<AppPageViewTab> getList(String propertyName, Object value)
			throws Exception {
		return null;
	}

	public Long getTotalCount() throws Exception {
		return null;
	}

	public void save(AppPageViewTab obj) throws Exception {

	}

	public void update(AppPageViewTab obj) throws Exception {

	}

	public void delete(AppPageViewTab obj) throws Exception {

	}

	public void delete(Integer id) throws Exception {

	}

	public List<AppPageViewTab> hqlGetList(String hql,
			Map<String, Object> argsMap) throws Exception {
		return appPageViewTabDao.hqlGetList(hql, argsMap);
	}

	public void hqlUpdate(String namedHqlQuery, Map<String, Object> argsMap)
			throws Exception {
		appPageViewTabDao.hqlUpdate(namedHqlQuery, argsMap);
	}

	public Long hqlGetNums(String namedHqlQuery, Map<String, Object> argsMap)
			throws Exception {
		return appPageViewTabDao.hqlGetNums(namedHqlQuery, argsMap);
	}

	public List<AppPageViewTab> sqlGetList(String sqls,
			Map<String, Object> argsMap) throws Exception {
		return appPageViewTabDao.sqlGetList(sqls, argsMap);
	}

	public void sqlUpdate(String sqls, Map<String, Object> argsMap)
			throws Exception {
		appPageViewTabDao.sqlUpdate(sqls, argsMap);
	}

	public Long sqlGetNum(String sqls, Map<String, Object> argsMap)
			throws Exception {
		return appPageViewTabDao.sqlGetNum(sqls, argsMap);
	}
	
	/**
	 * 根据页面ID，获得页面包含的View信息列表
	 * @param pageId
	 * @return
	 * @throws Exception
	 * @author 甘建新
	 * 2012-7-24下午03:10:19
	 */
	public List<AppPageViewTab> getViewListByPageId(int pageId)throws Exception{
		if (pageId>0) {
			Map<String, Object> argsMap = new HashMap<String, Object>();
			argsMap.put("pageId", pageId);
			List<AppPageViewTab> appPageViewList = this.hqlGetList("GET_VIEWLIST_BY_PAGEID", argsMap);
			return appPageViewList;
		}
		return null;
	}
	//Setter

	public void setAppPageViewTabDao(BaseDao<AppPageViewTab> appPageViewTabDao) {
		this.appPageViewTabDao = appPageViewTabDao;
	}
	
}